<?php
/*
 * Copyright 2008 by Oliver Radwan, Maxwell Palmer, Nolan McNair,
* Taylor Talmage, and Allen Tucker.  This program is part of RMH Homebase.
* RMH Homebase is free software.  It comes with absolutely no warranty.
* You can redistribute it and/or modify it under the terms of the GNU
* General Public License as published by the Free Software Foundation
* (see <http://www.gnu.org/licenses/ for more information).
*/

/**
 * Initializes the database by creating the tables:
 * dbWeeks, dbDates, dbShifts, dbLog, dbSCL,
 * dbPersons, dbSchedules
 * @version May 1, 2008
 * @author Oliver Radwan and Maxwell Palmer
 */
?>

<html>
<title>Database Initialization</title>
<body>
	<?php
	echo("Installing Tables...<br />");
	include_once('dbinfo.php');
	include_once('dbWeeks.php');
	include_once('dbMonths.php');
	include_once('dbShifts.php');
	include_once('dbDates.php');
	include_once('dbSCL.php');
	include_once('dbLog.php');
	include_once('dbSchedules.php');
	include_once('dbPersons.php');

	// connect
	$connected=connect();
	if (!$connected) echo("not connected...<br />");
	echo("connected...<br />");
	echo("database selected...<br />");

	// setup all of the tables
	setup_dbWeeks();
	echo("dbWeeks added...<br />");
	setup_dbMonths();
	echo("dbWeeks added...<br />");
	//SCHEDULE
	setup_dbSchedules();
	echo("dbSchedules added...<br />");
	//SHIFTS
	setup_dbShifts();
	echo("dbShifts added...<br />");
	//DATES
	setup_dbDates();
	echo("dbDates added...<br />");
	//PEOPLE
	setup_dbPersons();
	echo("dbPersons added...<br />");
	setup_dbSCL();
	echo("dbSCL added...<br />");
	setup_dbLog();
	echo("dbLog added...<br />");
	echo("Installation of mysql tables complete.");
	echo(" To prevent data loss, delete dbInstall.php from your website.</p>");


	?>
</body>
</html>
